home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 61 / CDRom61.iso / Programas / Express Search / exp_setup.exe / EXWEBDOCS.EXE / Express / Program / webdocs / template / shuffle.js < prev    next >
Encoding:
Text File  |  1999-04-12  |  1.9 KB  |  57 lines

  1. $EXP_INCLUDE "updown.js"
  2. <SCRIPT LANGUAGE="JavaScript">
  3. <!-- 
  4. function switchPosition(first, second) {
  5.     if (document.forms[0].sort != null)
  6.         document.forms[0].sort.checked = false;
  7.     tmp_value = document.forms[0].sl.options[second].value;
  8.     tmp_text = document.forms[0].sl.options[second].text;
  9.     document.forms[0].sl.options[second].value = document.forms[0].sl.options[first].value;
  10.     document.forms[0].sl.options[second].text = document.forms[0].sl.options[first].text;
  11.     document.forms[0].sl.options[first].value = tmp_value;
  12.     document.forms[0].sl.options[first].text= tmp_text;
  13.     document.forms[0].sl.selectedIndex = first;
  14. }
  15.  
  16. var button = "order";
  17. // if submit flag is true, this will submit the form
  18. function handleSubmit() {
  19.     param = "";
  20.     //Alert the user if it is remove category request
  21.     if (button =="removeOp"){
  22.         if (! confirm('Are you sure you want to remove the selected items?'))
  23.             return false;
  24.         }
  25.     // in sequence
  26.     for(i=0; i<    document.forms[0].sl.options.length; i++) {
  27.         param = param + "&seq=" + document.forms[0].sl.options[i].value;
  28.         if (document.forms[0].sl.options[i].selected) {
  29.             param = param + "&sl=" + document.forms[0].sl.options[i].value;
  30.         }
  31.     }
  32.     for(i=0; i<    document.forms[0].nsl.options.length; i++) {
  33.         if (document.forms[0].nsl.options[i].selected) {
  34.             param = param + "&nsl=" + document.forms[0].nsl.options[i].value;
  35.         }
  36.     }
  37.  
  38.     if (document.forms[0].sort != null)
  39.         sort_param    = "&sort=" + (document.forms[0].sort.checked?"1":"0");
  40.     else
  41.         sort_param    = "";
  42.     if (document.forms[0].catid == null) {    
  43.         self.location = document.forms[0].action+ "?" +button+"=1" + param + sort_param;
  44.             ;
  45.     }
  46.     else {
  47.         self.location = document.forms[0].action+ "?" +button+"=1" + param + "&catid=" +  document.forms[0].catid.options[document.forms[0].catid.selectedIndex].value + 
  48.             sort_param;
  49.     }
  50.  
  51.     return false;
  52.  
  53. }
  54. //-->
  55.  
  56. </SCRIPT>
  57.